package com.tengju.user.domain.model.sentiment;

import com.tengju.user.domain.model.staff.StaffSentimentCount;
import com.tengju.user.domain.model.staff.StaffSentimentRecord;
import com.tengju.user.domain.model.user.SsoUserId;
import com.tengju.user.domain.model.user.UserIdCode;
import com.tengju.user.domain.shared.Row;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface SentimentRepository {

    List<Sentiment> getBySsoUserIds(LocalDateTime createTimeFrom, LocalDateTime createTimeTo, List<SsoUserId> ssoUserIds);

    List<Sentiment> getByIdCodes(List<UserIdCode> userIdCodeList);

    List<StaffSentimentRecord> getStaffSentimentRecordPageList(List<SsoUserId> ssoUserIds,
                                                               LocalDateTime startDayMin,
                                                               LocalDateTime nextDayMin,
                                                               UserIdCode serviceProviderId,
                                                               int offset,
                                                               int limit);

    int getStaffSentimentRecordTotal(List<SsoUserId> ssoUserIds,
                                     LocalDateTime startDayMin,
                                     LocalDateTime nextDayMin,
                                     UserIdCode serviceProviderId);

    List<StaffSentimentCount> getStaffSentimentCountPageList(List<LocalDate> localDateBetween,
                                                             List<SsoUserId> ssoUserIds,
                                                             LocalDateTime startDayMin,
                                                             LocalDateTime nextDayMin,
                                                             boolean noRecord,
                                                             int offset,
                                                             int limit);

    List<StaffSentimentCount> getStaffSentimentCount(List<LocalDate> localDateBetween,
                                                     List<SsoUserId> ssoUserIds,
                                                     LocalDateTime startDayMin,
                                                     LocalDateTime nextDayMin,
                                                     boolean noRecord,
                                                     int offset,
                                                     int limit);


    int getStaffSentimentCountTotal(List<LocalDate> localDateBetween,
                                    List<SsoUserId> ssoUserIds,
                                    LocalDateTime startDayMin,
                                    LocalDateTime nextDayMin,
                                    boolean noRecord);


    Boolean addSentimentRecord(Sentiment sentiment);

    Boolean deleteSentimentRecordById(SentimentId sentimentId);

    Sentiment getSentimentRecordById(SentimentId sentimentId);

    Boolean updateSentimentRecord(SentimentId sentimentId, String sentimentContext, SsoUserId ssoUserId, String operator);


    List<Row> monthSentimentRecordChartAnalysis(List<SsoUserId> ssoUserIds,
                                                List<LocalDate> localDateBetween,
                                                LocalDateTime startMonthMin,
                                                LocalDateTime nextMonthMin);
}
